<template>
  <div>
    <component :is="one"></component>

    <div id="container" >
      <div id="content2">
        <table width="100%" height="41"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="15" height="18" align="left" valign="top">
              <div align="left"></div>
            </td>
      <td width="385" align="left" valign="bottom" class="12">&nbsp;</td>
    </tr>
          <tr>
            <td height="4" colspan="2" align="left" valign="bottom"></td>
    </tr>
          <tr>
            <td height="15" align="left" valign="top">&nbsp;</td>
      <td height="15" align="left" valign="top" class="12"><table width="100%" height="20" border="0" cellpadding="0" cellspacing="0"><tr><td height="20"><div class="right_proaducts">我的位置&gt;&gt;科技项目申报&gt;项目修改<br />
        <br /></div>
        <!--              <form action="admin_index.html" method="post" id="form" onsubmit="return checkProjict(this)">-->
<!--        <DIV class=padding><DIV id=middlebody>-->
          <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
            <tr><td><div align="left">|&nbsp;&nbsp;欢迎,admin&nbsp;&nbsp;|&nbsp;&nbsp;<a
                class="table_t"
                href="#/">注销      </a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">后退</a>&nbsp;&nbsp;|</div></td>
                <td>
                  <div align="center"><a
                          href="#/admin/showusers">登录用户管理</a>
                  </div>
              </td>
              <td>
                  <div align="center"><a
                          href="#/admin/showexperts">专家信息管理</a>
                  </div>
              </td>
              <td height="50">
                  <div align="center"><a
                          href="#/admin/showunits">单位信息管理</a>
                  </div>
              </td>
              <td>
                  <div align="center"><a
                          href="#/admin/showprojectCategorys">项目管理</a>
                  </div>
              </td>
            </tr></tbody></table>
          <table id="app" width="50%" height="50" border="0" align="center" cellpadding="0" cellspacing="1"><tbody><tr>
            <td width="25%" bgcolor="#f3f3f3">项目名称分类</td>
            <td width="75%" bgcolor="#f3f3f3">
              <input v-model="projectCategory.categoryname"  type="text"  /><br/>
              <button @click="updateProjectCategory()">修改</button>
            </td>
          </tr><tr><td bgcolor="#f3f3f3">&nbsp;</td>
            <!--                      <td bgcolor="#f3f3f3"><input type="submit" name="Submit" value="修改" /></td>-->
          </tr></tbody></table>
          <div></div>
          <!--              </form>-->
      </td>
      </tr></table>
        <br/><div class="table_wz"></div></td>
    </tr></table>
    </div>
    </div>

    <component :is="two"></component>
  </div>
</template>
<script>
    import four from '../../util/four';
    import aaa from '@/components/header.vue'
    import bbb from '@/components/footer.vue'
    const options = {
        data() {
            return {
              one: 'aaa',
                two: 'bbb',
                projectCategory: {},
            }
        },
        components:{
            aaa,bbb
        },
        mounted() {
            this.getProjectCategory();
        },
        methods: {
            getProjectCategory(){
                let parse = JSON.parse(sessionStorage.getItem("projectCategory"));
                this.projectCategory=parse;
            },
            updateProjectCategory(){
                four.put("/projectCategorys",this.projectCategory).then((res)=>{
                    if (res.data.code==20031){
                        this.$message.success("修改成功！");
                    }
                    if (res.data.code==20030){
                        this.$message.success("修改失败！");
                    }
                }).finally(()=>{
                   this.$router.push('/admin/showprojectCategorys');
                })
            },
        }
    }
    export default options;
</script>